package com.web.common.enums;

/**
 * @author wenzhuo
 * @create 2024-03-28 2024/3/28
 */

public enum PendingAction {

    ADD("ADD", "create"),
    DEL("DEL", "delete"),
    MOD("MOD", "modify"),
    ;
    // 成员变量
    private String action;
    private String description;
    // 构造方法
    private PendingAction(String action, String description) {
        this.action = action;
        this.description = description;
    }

    // 普通方法
    public static String generateDescription(String action) {
        for (PendingAction pendingAction : PendingAction.values()) {
            if (action.equals(pendingAction.getAction())) {
                return pendingAction.getDescription();
            }
        }
        return null;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
